
// 网格宽度
const GRID_WIDTH = 630;
// 网格高度
const GRID_HEIGHT = 630;

// 网格宽行数
const GRID_ROWS = 9;
// 网格列数
const GRID_COLUMNS = 9;
// 格子像素
const CELL_WIDTH = 70;
const CELL_HEIGHT = 70;

// 偏移像素
const OFFSET_X = Math.floor((GRID_WIDTH - CELL_WIDTH*GRID_COLUMNS) / GRID_COLUMNS);
const OFFSET_Y = Math.floor((GRID_HEIGHT - CELL_HEIGHT*GRID_ROWS) / GRID_ROWS);

// 格子动画状态
const CELL_STATUS = {
    common: 'normal',
    click: 'click',
    line: 'line',
    column: 'column',
    wrap: 'wrap',
    bird: 'bird'
};

// 格子类型
const CELL_TYPE = {
    empty: 0,
    a: 1,
    b: 2,
    c: 3,
    d: 4,
    e: 5,
    f: 6,
    bird: 7
};

// 格子种类数量
const CELL_NUM = 6;

// 动画播放时间 animation time
const ANI_TIME = {
    move: 0.4,
    die: 0.4,
    down: 1,
    bomb_delay: 0.4,
    bomb_bird_delay: 0.6,
    die_shake: -0.6 // 死前抖动
};

// 格子所有动作
const CELL_ACTION = {
    moveTo: 'moveTo',
    toDie: 'die',
    setVisible: 'visible',
    toShake: 'shake',
};

// 特效动作
const CELL_EFFECT_ACTION = {
    crush: 'crush',
    rowBomb: 'rowBomb',
    colBomb: 'colBomb',
};


// 格子动画特效
const CELL_ANIM = {
    effect: 'effect',
    click: 'click',
    effectLine: 'effect_line',
    effectCol: 'effect_col',
};

module.exports = {
    GRID_WIDTH,
    GRID_HEIGHT,
    GRID_ROWS,
    GRID_COLUMNS,
    CELL_WIDTH,
    CELL_HEIGHT,
    CELL_STATUS,
    CELL_TYPE,
    CELL_NUM,
    OFFSET_X,
    OFFSET_Y,
    ANI_TIME,
    CELL_ACTION,
    CELL_EFFECT_ACTION,
    CELL_ANIM,
};